<%@ page import="com.scalar.chiptrack.utils.ConfigManager, java.util.Calendar"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>

<%String chipTracContext = "/" + ConfigManager.getChipTracContext();%>

<HTML>
    <HEAD><TITLE>Scalarsoft - ChipTrac</TITLE>
    <META http-equiv=Content-Type content="text/html; charset=windows-1252">
    <LINK href="<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css" type="text/css" rel=stylesheet>
    <SCRIPT language="JavaScript" src="<%=chipTracContext%>/jsp/includes/scripts/functions.js"></SCRIPT>
    <SCRIPT language="JavaScript" src="<%=chipTracContext%>/jsp/includes/scripts/validations.js"></SCRIPT>
    <SCRIPT>
        function openWorkOrderDetailsWindow( QADDueDate )
        {
            var LeftPos=(screen.width)?(screen.width-500)/2:100;
            var TopPos=(screen.height)?(screen.height-450)/2:100;
            newWindow = window.open ('<%=chipTracContext%>/jsp/operations/work_order_details_not_started_per_plan.jsp','workOrderDetails','channelmode=no,directories=no,toolbar=no,menubar=no,personalbar=no,status=yes,scrollbars=yes,width=540,height=500,resizable=yes,Left= '+LeftPos+',top='+TopPos);
            if(!newWindow.opener)
            {
                newWindow.opener = window
            }
            newWindow.focus();
        }
        function toggle( woDetailsId, imgId )
        {
            var woDetailsTR      = document.getElementById ( woDetailsId );
            var imgCtrl          = document.getElementById ( imgId );
            if ( woDetailsTR.style.display == 'none' )
            {
                woDetailsTR.style.display = 'block'
                imgCtrl.src ="<%=chipTracContext%>/jsp/includes/images/minus.gif";
            }
            else
            {
                woDetailsTR.style.display = 'none'
                imgCtrl.src ="<%=chipTracContext%>/jsp/includes/images/plus.gif";
            }
        }
    </SCRIPT>
    <style>
    <!--
    .HEADING     { cursor: hand; font-family: Verdana,Arial,San Serif; font-size: 12px; color: #000000;
                   background-color: #FFFFFFF; font-weight: none;
                   border: 1 solid #000000 }
    -->
    </style>
    </HEAD>
    <BODY bgColor="#ffffff" leftMargin=0 topMargin=0 marginheight="0" marginwidth="0">

    <!-- Top Header Start-->
    <%@ include file="/jsp/includes/header.jsp" %>
    <!-- Top Header End-->

    <TABLE cellSpacing=0 cellPadding=0 width="100%" border="0">
        <TBODY>
            <TR>
                <td width='180' valign='top' background='<%=chipTracContext%>/jsp/includes/images/left_red_bg.gif'>
                    <!-- Side Navigation start -->
                    <%@ include file="/jsp/operations/qad_reports_side_menu.jsp" %>
                    <!-- end of the side navigations -->
                </td>
                <TD bgcolor="#ffffff"><IMG height=9 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=8></TD>
                <TD bgcolor="#ffffff"><IMG height=480 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2></TD>

                <TD valign="top" width="100%">
                    <IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/clear.gif" width=500 border=0>
                    <BR><BR>
                    <CENTER><span class="NArialW">Work Order Not Started per Plan</SPAN></CENTER>
                    <%--<img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height="10">--%>
                    <TABLE>
					    <TR>
						    <TD CLASS="NArialL">
                                <chiptrack:errors styleClass='NArialL'/>
                            </TD>
					    </TR>
                        <TR>
						    <TD CLASS="NArialL">
                                <chiptrack:info styleClass='NArialL'/>
                            </TD>
					    </TR>
                    </TABLE>
                    <html:form action="qadReportsAction" name="qadReportsForm" type="com.scalar.chiptrack.operations.reports.forms.QADReportsForm">
                    <TABLE border="0" align="center" width="60%">

                        <TR  bgcolor="#993333" class="NArialL" align="center">
                            <TD nowrap style="color:#FFFFFF">QAD Due Date</TD>
                            <TD nowrap style="color:#FFFFFF">#ORD - Not Start per Plan</TD>
                        </TR>
                        <logic:present property="woMap" name="qadReportsForm">
                        <logic:iterate id="workOrdersMap" property="woMap" name="qadReportsForm" indexId="idx">
                            <bean:define id="woDate" property="key" name="workOrdersMap"/>
                            <bean:define id="workOrders" property="value" name="workOrdersMap"/>
                            <bean:size id="size" name="workOrders"/>
                        <TR CLASS="bodyText" bgcolor='<%=(idx.intValue()%2)==0?"#FFFFEE":"#DEE1E2"%>' >
                            <TD>
                                &nbsp;<bean:write name="woDate"/></TD>
                            <TD align="right" style="cursor:hand" onclick="toggle('woDetails<%=idx%>','img<%=idx%>')"><%=size%>&nbsp;<IMG src="<%=chipTracContext%>/jsp/includes/images/plus.gif" width="10" id="img<%=idx%>"></TD>
                        </TR>
                        <TR style="display:none" id="woDetails<%=idx%>">
                            <TD COLSPAN="2">
                                <TABLE width="100%">
                                    <TR BGCOLOR="#F2DBDB" CLASS="NArialL" ALIGN="center">
                                        <TD>Work Order Number</TD>
                                        <TD>Part Number</TD>
                                        <TD>QAD Rel Date</TD>
                                        <TD>Qty Open</TD>
                                        <TD>Curr. Stage</TD>
                                        <TD>SOD</TD>
                                    </TR>
                                    <logic:iterate id="workOrder" name="workOrders">
                                    <TR CLASS="NArialL" BGCOLOR='#CDCEE9'>
                                        <TD ALIGN="CENTER"><bean:write name="workOrder" property="woNumber"/></TD>
                                        <TD ALIGN="CENTER" nowrap><bean:write name="workOrder" property="partNumber"/></TD>
                                        <TD ALIGN="CENTER" nowrap><bean:write name="workOrder" property="woRelDate"/></TD>
                                        <TD ALIGN="RIGHT"><bean:write name="workOrder" property="woQtyOpen"/></TD>
                                        <TD><bean:write name="workOrder" property="stage"/></TD>
                                        <TD nowrap><bean:write name="workOrder" property="sod"/></TD>
                                    </TR>
                                    </logic:iterate>
                                </TABLE>
                            </TD>
                        </TR>
                        </logic:iterate>
                            <bean:size id="size" property="woMap" name="qadReportsForm"/>
                            <logic:equal value="0" name="size">
                                <TR CLASS="NArialL">
                                    <TD COLSPAN="2" style="color:red">&nbsp;&nbsp;NO Work Order information found</TD>
                                </TR>
                            </logic:equal>
                        </logic:present>
                        <logic:notPresent property="woMap" name="qadReportsForm">
                            <TR CLASS="NArialL">
                                <TD COLSPAN="2" style="color:red">&nbsp;&nbsp;NO Work Order information found</TD>
                            </TR>
                        </logic:notPresent>

                    </TABLE>
                    </html:form>
                </TD>

                <TD bgcolor="#ffffff"><IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=1></TD>
            </TR>
        </TBODY>
    </TABLE>
    <!-- Footer starts here -->
    <%@ include file="/jsp/includes/footer.jsp" %>
    <!-- footer end here -->
    </BODY>
</HTML>